/* Endless Code Copyright (C) 2009 Jingul,Kim
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 */
package ec.gfx.ui;

import ec.Result;
import ec.core.event.MouseEvt;
import ec.gfx.Scene;

/**
 * @since 2009
 * @version 1.0
 * @author <a href="mailto:jingul.kim@gmail.com">Jingul,Kim</a>
 */
public class Dialog extends Pack {
	private Handle handle;
	
	public Dialog(Handle handle) {
		this.handle = handle;
		
		handle.push(this);
		
		System.out.println("box : " + hashCode());
	}
	
	@Override
	public Result now(Scene scene) {
//		GL.color3f(1.0f, 1.0f, 1.0f);
//		GL.rectf(0.0f, 0.0f, w, -h);
		
		return super.now(scene);
	}
	
	@Override
	public void processMouseEvt(MouseEvt e) {
		switch(e.getType()) {
		case MouseEvt.DOWN:
			handle.setFocused(this);
			System.out.println("focused : " +handle.getFocused().hashCode());
		default:
		}
		
		super.processMouseEvt(e);
	}
}
